﻿@model IEnumerable<Back_end.Models.ApplicationUser>

@{
    ViewBag.Title = "用户信息";
}

@if (ViewBag.Sub == null)
{
    <h2>@ViewBag.Title</h2>;
}
else
{
    <h2></h2>
        <ul class="breadcrumb">
            <li>@Html.ActionLink("搜索", "Index")</li>
            <li>按 @ViewBag.Sub 搜索</li>
        </ul>
}

@using (Html.BeginForm("Index", "ApplicationUsers", FormMethod.Get))
{
	<div class="row">
		<div class="col-md-2">
			@Html.DropDownList("genre",
							new List<SelectListItem> {
								new SelectListItem { Text = "用户名", Selected = true },
								new SelectListItem { Text = "真实姓名" },
								new SelectListItem { Text = "所在地" }},
							htmlAttributes: new { @class = "form-control" })
		</div>
		<div class="col-md-4 form-group">
			<div class="input-group">
				<span class="input-group-addon glyphicon glyphicon-search"></span>
				@Html.TextBox("search", null, htmlAttributes: new { @class = "form-control", @placeholder = "输入搜索条件" })
				<span class="input-group-btn">
					<button class="btn btn-primary" type="submit">搜索</button>
				</span>
			</div>
		</div>
	</div>
}

<table class="table table-striped table-hover">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.UserName)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.RealName)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.TotleCredit)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Gender)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Location)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.LastestDate)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Email)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.UserName)
        </td>
        <td>
            @item.RealName
        </td>
        <td>
			@Html.DisplayFor(modelItem => item.TotleCredit)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Gender)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Location)
        </td>
        <td>
            @{ string ld = item.LastestDate == null ? "无" : item.LastestDate.ToString(); }
            @ld
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Email)
        </td>
        <td>
            @Html.ActionLink("编辑", "Edit", new { id=item.Id }) |
            @Html.ActionLink("详细", "Details", new { id=item.Id })
        </td>
    </tr>
}

</table>
